home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / programm.ing / gfa / gfacode.arc / GETBOOT.LST < prev    next >
Encoding:
File List  |  1990-11-14  |  1.9 KB  |  56 lines

  1. '  Getting drive info from the
  2. '  boot sector!!!
  3. '
  4. ' drive% is the drive you want to
  5. ' check (0-A:, 1-B:)
  6. @getboot(0)
  7. END
  8. '
  9. PROCEDURE getboot(drive%)
  10.   DIM sector|(512)
  11.   sectadd%=VARPTR(sector|(0))
  12.   ~XBIOS(8,L:sectadd%,L:0,drive%,1,0,0,1)
  13.   serial%=(sector|(10)*&H1000)+(sector|(9)*&H100)+sector|(8)
  14.   ' Note:  Boot sector info is in low-byte, high-byte form
  15.   bps%=(sector|(12)*&H100)+sector|(11)
  16.   spc%=sector|(13)
  17.   res%=(sector|(15)*&H100)+sector|(14)
  18.   nfats%=sector|(16)
  19.   ndirs%=(sector|(18)*&H100)+sector|(17)
  20.   nsects%=(sector|(20)*&H100)+sector|(19)
  21.   media%=sector|(21)
  22.   spf%=(sector|(23)*&H100)+sector|(22)
  23.   spt%=(sector|(25)*&H100)+sector|(24)
  24.   nsides%=(sector|(27)*&H100)+sector|(26)
  25.   nhid%=(sector|(29)*&H100)+sector|(28)
  26.   execflg%=(sector|(31)*&H100)+sector|(30)
  27.   ldmode%=(sector|(33)*&H100)+sector|(32)
  28.   ssect%=(sector|(35)*&H100)+sector|(34)
  29.   sectcnt%=(sector|(37)*&H100)+sector|(36)
  30.   ldaddr%=(sector|(41)*&H10000)+(sector|(40)*&H1000)+(sector|(39)*&H100)+sector|(38)
  31.   fatbuf%=(sector|(45)*&H10000)+(sector|(45)*&H1000)+(sector|(43)*&H100)+sector|(42)
  32.   bootname$=CHAR{sectadd%+46}
  33.   PRINT "Disk serial number: ";serial%
  34.   PRINT "Bytes per sector: ";bps%
  35.   PRINT "Sectors per cluster: ";spc%
  36.   PRINT "Number of reserved sectors: ";res%
  37.   PRINT "Number of FATs: ";nfats%
  38.   PRINT "Number of possible directory entries: ";ndirs%
  39.   PRINT "Number of sectors on disk: ";nsects%
  40.   PRINT "MEDIA description: ";media%
  41.   PRINT "Sectors per FAT: ";spf%
  42.   PRINT "Sectors per track: ";spt%
  43.   PRINT "Number of sides: ";nsides%
  44.   PRINT "Number of hidden sectors: ";nhid%
  45.   PRINT "Flag for COMMAND.PRG: ";execflg%
  46.   PRINT "Flag for file or sector boot: ";ldmode%
  47.   PRINT "First sector to be loaded: ";ssect%
  48.   PRINT "Number of sectors to load: ";sectcnt%
  49.   PRINT "Load address: ";ldaddr%
  50.   PRINT "FAT address: ";fatbuf%
  51.   PRINT "Boot program filename: ";bootname$
  52.   PRINT
  53.   PRINT "Press a key to continue"
  54.   ~INP(2)
  55. RETURN
  56.